Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base directory octopus #1370

Closed
wants to merge 6 commits into from
Closed

Base directory octopus #1370

wants to merge 6 commits into from

Conversation

juped
Copy link
Member

@juped juped commented May 13, 2023

An octopus of:

Review those individually please, ignore their CI which will certainly fail. (Cancelling it now actually)

juped added 4 commits May 13, 2023 14:17
The application data directory standards on Windows and Mac use
organization names in the directory paths. On Windows, this is a path
like `%AppData%\OrgName\AppName`, while on Mac it is a path like
`$HOME/Library/Application Support/com.example.AppName`, using a
Java-like embedding into DNS, for Mac application bundles.

Namada does not provide a Mac application bundle, so the DNS embedding
is unnecessary, and "heliax.com" is not the correct domain name in any
case. Therefore, use an empty string for the domain qualifier.

The correct organization name for Namada might be "Namada" if one were
necessary, but it would be redundant with the application name.
Therefore, use an empty string for the organization name.

This results in paths like `%AppData\namada` for Windows and
`$HOME/Library/Application Support/namada` for Mac.

The Unix directory name, `$XDG_DATA_HOME/namada`, is unaffected.

A useful citation follows:

File System Programming Guide (for Mac):
https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html
(see Table 1-3; note that it specifies "your app's bundle identifier or
your company" but many organizations or communities, like Namada, are
not companies; we can read this broadly to encompass "Namada", and it
is not unheard of to use a simple application name here.)
By Mac and Windows convention, application names are upcased, while
by Unix convention they are downcased. The directories crate will
downcase it on Unix for us; therefore, upcase it here.
The Namada data directory contains very large blockchain databases
which should not be included in a user's roaming profile.

Note that, if the data directory is split in the future, files like
e.g. wallets would belong in the roaming profile.
The CLI help needs to reflect the updated default data dirs.
@juped juped force-pushed the ray/base-directory-octopus branch from 1f6d1f4 to 8a85a37 Compare May 13, 2023 21:22
@juped juped mentioned this pull request May 13, 2023
@juped juped force-pushed the ray/base-directory-octopus branch from 8a85a37 to f6a0e22 Compare May 14, 2023 13:24
juped added 2 commits May 14, 2023 13:47
Now that Namada defaults to platform-compliant (e.g. XDG) default data
directories, the DEFAULT_BASE_DIR constant (".namada") should no longer
exist. Remove it, using get_default_namada_folder() in places which
referenced it.

The ultimate fallback in case get_default_namada_folder() fails remains
".namada", but this is now just a string inside
get_default_namada_folder(). This will not happen except in
pathological cases where e.g. no $HOME exists; the details are in the
documentation for the directories crate.
…y-no-constant' and 'ray/base-directory-organizations' into main

* ray/base-directory-windows-local:
  apps/config: use non-roaming profile on Windows

* ray/base-directory-no-constant:
  apps/config: remove DEFAULT_BASE_DIR constant

* ray/base-directory-organizations:
  apps/cli: update default data dirs in cli help
  apps/config: upcase "Namada" for data directories
  apps/config: use blank domain and organization
@juped juped force-pushed the ray/base-directory-octopus branch from f6a0e22 to 800d275 Compare May 14, 2023 17:48
@juped juped closed this May 15, 2023
@juped juped deleted the ray/base-directory-octopus branch May 15, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant